﻿namespace Fortunate.ViewModel.FilesModule
{
    /// <summary>
    /// 文件存储路径（后续补充）
    /// </summary>
    public class FileStorage
    {
        static string Level = "";

        /// <summary>
        /// 
        /// </summary>
        private static string general => DateTime.Now.ToString("yyyy-MM-dd");

        /// <summary>
        /// pdf
        /// </summary>
        private static string GetPdfUrl => $"{Level}\\pdf\\{general}";

        /// <summary>
        /// xlsx
        /// </summary>
        private static string GetXlsxUrl => $"{Level}\\xlsx\\{general}";

        /// <summary>
        /// 临时文件存储
        /// </summary>
        private static string GetTemp => $"{Level}\\temp\\{general}";

        /// <summary>
        /// 获取保存路径
        /// </summary>
        /// <param name="type">文件类型（* = 存储为临时文件夹 ，后续没有的类型待补充）</param>
        public static string GetSavePath(string type)
        {
            type = type.ToLower();
            switch (type)
            {
                case ".pdf":
                    return GetPdfUrl;
                case ".xlsx":
                    return GetXlsxUrl;
                default:
                    return GetTemp;
            }
        }

    }
}
